home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-04 | 42.4 KB | 1,224 lines |
- C.S.M.P. Digest Wed, 13 May 92 Volume 1 : Issue 79
-
- Today's Topics:
-
- MPW QUESTIONS
- "Use Custom Icon" Finder flag - info?
- How to tell if a window has a title bar?
- Checking if modem or printer port is already in use
- Does MPW support aliases?
- Animating floating point numbers?
- Discipline, Mbg 6.2.2, Quadra
- THINK C PROGRAM QUESTION
- Simple Sound Program
- UPMG II
- Centering window from an INIT; how?
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
-
- These digests are available (by using FTP, account anonymous, your email
- address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
- edu. This is also the home of the comp.sys.mac.programmer Frequently Asked
- Questions list. The last several issues of the digest are available from
- sumex-aim.stanford.edu as well.
-
- These digests are also available via email. Just send a note saying that you
- want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
- automatically receive each new digest as it is created.
-
- The digest is a collection of articles from the internet newsgroup comp.sys.
- mac.programmer. It is designed for people who read c.s.m.p. semi-regularly
- and want an archive of the discussions. If you don't know what a newsgroup
- is, you probably don't have access to it. Ask your systems administrator(s)
- for details. (This means you can't post questions to the digest.)
-
- The articles in these digests are taken directly from comp.sys.mac.programmer.
- They are not edited; all articles included in this digest are in their original
- posted form. The only articles that are -not- included in these digests are
- those which didn't receive any replies (except those that give information
- rather than ask a question). All replies to each article are concatenated
- onto the original article in the order in which they were received. Article
- threads are not added to the digests until the last article added to the
- thread is at least one month old (this is to ensure that the thread is dead
- before adding it to the digests).
-
- Send administrative mail to mkelly@cs.uoregon.edu.
-
- -------------------------------------------------------
-
- From: chrism@col.hp.com (Chris Magnuson)
- Subject: MPW QUESTIONS
- Date: 12 Apr 92 20:57:52 GMT
- Organization: HP Colorado Springs Division
-
- Two questions:
-
- 1. Does anyone have experience with the Incremental Build System utility from
- Jasik? I want to know how much it costs, where to get it, and whether it
- makes links any faster (how much?).
-
- 2. Is it true that Think Pascal is much faster than MPW Pascal?
-
- Thanks,
- Chris Magnuson
- chrism@col.hp.com
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 13 Apr 92 08:00:22 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- > chrism@col.hp.com (Chris Magnuson) writes:
-
- 2. Is it true that Think Pascal is much faster than MPW Pascal?
-
- Definately.
-
- - --
- "You should meet yourself someday. I'm sure you would hate it."
- - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
-
- ---------------------------
-
- From: bdugan@hal.gnu.ai.mit.edu (Bill Dugan)
- Subject: "Use Custom Icon" Finder flag - info?
- Date: 12 Apr 92 23:59:37 GMT
- Organization: MIT Laboratory for Computer Science
-
- I was poking around on my friend's Quadra today and saved a GIF from
- Photoshop 2.0...and the icon created was a miniature version of the GIF itself!!
- Wow!!! That's the greatest thing I've ever seen, I said...Poking around,
- I found a flag from Resedit called "Use Custom Icon".
-
- Is this documented anywhere? I want my own apps to use this wonderful
- system idea....
-
- bill
-
- - --
- Bill Dugan
- bdugan@gnu.ai.mit.edu
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
- Date: 13 Apr 92 08:03:30 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- > bdugan@hal.gnu.ai.mit.edu (Bill Dugan) writes:
-
- Photoshop 2.0...and the icon created was a miniature version of the GIF
- itself!! Wow!!! That's the greatest thing I've ever seen, I said...
- Poking around, I found a flag from Resedit called "Use Custom Icon".
-
- Is this documented anywhere? I want my own apps to use this wonderful
- system idea....
-
- Yes, it's documented in Inside Mac VI. However, it's only
- available under the system 7 Finder.
-
- - --
- "You should meet yourself someday. I'm sure you would hate it."
- - - Me: h+@nada.kth.se; Jon W{tte (The Diplomat - NOT!)
-
- ---------------------------
-
- From: tnorthtj@cc.curtin.edu.au (Tim North)
- Subject: How to tell if a window has a title bar?
- Date: 26 Mar 92 02:15:42 GMT
- Organization: Curtin University of Technology
-
- I'm trying to center my windows on the screen. Sounds simple, and it is.
- The problem though, is that I am using the window's portRect to determine
- its dimensions, and the portRect doesn't take into account the height of the
- title-bar (if there is one).
-
- Simple to fix, thinks I, I'll just look at the windowKind field in the
- WindowRecord. Nope. This is just 2 if its a dialog or 8 otherwise. (Remember,
- modeless dialogs have a title-bar, modal ones don't, so that's no use.)
-
- How then do I determine if my window has a title-bar? (Or, just in case I've
- lost the woods for the trees, how do I accurately center my windows?)
-
- Regards,
- - -------------------------------------------------------------------------------
- _--_|\ | Dept Computer Engineering, Curtin University of Technology
- / \ | Perth. Western Australia. 6102. Phone: (+61 9) 351 7908
- - -->\_.--._/ | Internet: North_TJ@cc.curtin.edu.au
- v | Bitnet: North_TJ%cc.curtin.edu.au@cunyvm.bitnet
- TIM NORTH | UUCP: uunet!munnari.oz!cc.curtin.edu.au!North_TJ
- - -------------------------------------------------------------------------------
-
- +++++++++++++++++++++++++++
-
- From: asunta@convex.csc.FI (Miika Asunta)
- Date: 26 Mar 92 18:51:08 GMT
- Organization: Finnish Academic and Research Network Project - FUNET
-
- In <1992Mar26.111542.1@cc.curtin.edu.au> tnorthtj@cc.curtin.edu.au (Tim North) writes:
-
- >I'm trying to center my windows on the screen. Sounds simple, and it is.
- >The problem though, is that I am using the window's portRect to determine
- >its dimensions, and the portRect doesn't take into account the height of the
- >title-bar (if there is one).
-
- >Simple to fix, thinks I, I'll just look at the windowKind field in the
- >WindowRecord. Nope. This is just 2 if its a dialog or 8 otherwise. (Remember,
- >modeless dialogs have a title-bar, modal ones don't, so that's no use.)
-
- >How then do I determine if my window has a title-bar? (Or, just in case I've
- >lost the woods for the trees, how do I accurately center my windows?)
-
- You should use rgnBBox Rect of structRgn from WindowRecord instead
- of portRect.
-
- In C you can assign it directly...
-
- void foo()
- {
- WindowPeek wp;
- Rect windowboundsrect;
-
- windowboundsrect=(**(wp->structRgn)).rgnBBox;
- }
-
- Hope this helps,
-
- Miika
- - --
- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
- & Miika Asunta & asunta@convex.csc.fi & Double Bass Player &
- & tel. +358-0-494 093 & & Macintosh Programmer &
- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
- +++++++++++++++++++++++++++
-
- From: Michael_Hecht@mac.sas.com (Michael Hecht)
- Organization: SAS Institute Inc.
- Date: Thu, 26 Mar 1992 20:03:05 GMT
-
- In article <1992Mar26.111542.1@cc.curtin.edu.au>,
- tnorthtj@cc.curtin.edu.au (Tim North) writes:
- > How then do I determine if my window has a title-bar?
-
- Here's how I compute the height of a window's title bar:
-
- /* Convert window's portRect to global coordinates */
- windRect = theWindow->portRect;
- LocalToGlobal( &topLeft( windRect ));
- LocalToGlobal( &botRight( windRect ));
-
- /* Calculate the height of the window's title bar */
- bias = windRect.top - 1 - ( *(( WindowPeek )theWindow )->strucRgn )->rgnBBox.top;
- windRect.top -= bias;
-
- > (Or, just in case I've lost the woods for the trees, how do I accurately
- > center my windows?)
-
- Here's what I do:
-
- /* CenterRect: Center a rectangle on the main screen */
- static void CenterRect( Rect *r )
- {
- short delta, screenTop;
-
-
- /* Center it horizontally */
- delta = r->right - r->left;
- r->left = ( screenBits.bounds.right - delta ) >> 1;
- r->right = r->left + delta;
-
- /* Determine top of screen */
- screenTop = GetMBarHeight();
-
- /* Place it in upper third of screen */
- delta = r->bottom - r->top;
- r->top = ( screenBits.bounds.bottom - screenTop - delta ) / 3 + screenTop;
- r->bottom = r->top + delta;
- }
-
- void CenterDialog( short id, Point *corner )
- {
- DialogTHndl theDLOG;
- Rect bounds;
-
-
- /* Get the DLOG resource */
- theDLOG = ( DialogTHndl )GetResource( 'DLOG', id );
- if( !theDLOG )
- return;
-
- /* Center it within screenBits */
- bounds = ( *theDLOG )->boundsRect;
- CenterRect( &bounds );
- ( *theDLOG )->boundsRect = bounds;
-
- if( corner )
- *corner = topLeft( bounds );
- }
-
- static void CenterAlert( short id )
- {
- AlertTHndl theALRT;
- Rect bounds;
-
-
- /* Get the ALRT resource */
- theALRT = ( AlertTHndl )GetResource( 'ALRT', id );
- if( !theALRT )
- return;
-
- /* Center it within screenBits */
- bounds = ( *theALRT )->boundsRect;
- CenterRect( &bounds );
- ( *theALRT )->boundsRect = bounds;
- }
-
- short DoAlert( short kind, short alertID, ProcPtr filterProc )
- {
- short item;
-
-
- CenterAlert( alertID );
- SetCursor( &arrow );
- switch( kind ) {
-
- case stopIcon:
- item = StopAlert( alertID, filterProc );
- break;
-
- case noteIcon:
- item = NoteAlert( alertID, filterProc );
- break;
-
- case cautionIcon:
- item = CautionAlert( alertID, filterProc );
- break;
-
- default:
- item = Alert( alertID, filterProc );
- break;
- }
-
- return item;
- }
-
-
- For dialogs, I call CenterDialog. It will optionally hand me back the top,left
- coordinate (handy for calls to SFGetFile, etc.). For alerts, I just call
- DoAlert, which will center it for me. Note that it adjusts for the menu bar
- but not for the title bar. This is because my method is used BEFORE calling
- GetNewDialog, as it tweaks the in-memory copy of the DLOG resource. There's
- no structure region to peek at at that time. If you're centering the window
- after its created, you could use the bounding box of the window's structure
- region, rather than its portRect. That would take care of the title bar as
- well as anything else.
-
- Have fun!
-
- - --Michael
-
- =======================================================================
- Michael P. Hecht | Internet: Michael_Hecht@mac.sas.com
- SAS Institute Inc.; Cary, NC USA | AppleLink: SAS.HECHT
-
- +++++++++++++++++++++++++++
-
- From: Joe.Francis@dartmouth.edu (Joe Francis)
- Date: 26 Mar 92 21:25:38 GMT
- Organization: Dartmouth College, Hanover, NH
-
- In article <1992Mar26.185108.14007@nic.funet.fi>
- asunta@convex.csc.FI (Miika Asunta) writes:
-
- >>How then do I determine if my window has a title-bar? (Or, just in case I've
- >>lost the woods for the trees, how do I accurately center my windows?)
- [Tim North]
-
- > You should use rgnBBox Rect of structRgn from WindowRecord instead
- > of portRect. [Miika Asunta]
-
- No. This value will be invalid if the window has not been drawn on the
- screen. Since one of the primary uses of centering windows is to
- create the window invisible, center it, and then show it, structRgn is
- not a general solution to this problem.
-
- I even tried sending the WDEF a calc regions message to try to fool it
- into validating structRgn, but (under system 7, at least) this will
- result in confusing the window manager beyond help.
-
- I don't have a good general solution to this problem. I end up looking
- at the window variant and assuming it's a standard window variant (as
- opposed to a custom WDEF that might have a different structure region
- from the standard WDEF). If anyone can improve on this, please clue
- the rest of us in!
-
- +++++++++++++++++++++++++++
-
- From: f85-tno@nada.kth.se (Tommy Nordgren)
- Date: 6 Apr 92 15:14:47 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>, Joe.Francis@dartmouth.edu (Joe Francis) writes:
- |> In article <1992Mar26.185108.14007@nic.funet.fi>
- |> asunta@convex.csc.FI (Miika Asunta) writes:
- |>
- |> >>How then do I determine if my window has a title-bar? (Or, just in case I've
- |> >>lost the woods for the trees, how do I accurately center my windows?)
- |> [Tim North]
- |>
- |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
- |> > of portRect. [Miika Asunta]
- |>
- |> No. This value will be invalid if the window has not been drawn on the
- |> screen. Since one of the primary uses of centering windows is to
- |> create the window invisible, center it, and then show it, structRgn is
- |> not a general solution to this problem.
- |>
- |> I even tried sending the WDEF a calc regions message to try to fool it
- |> into validating structRgn, but (under system 7, at least) this will
- |> result in confusing the window manager beyond help.
- |>
- |> I don't have a good general solution to this problem. I end up looking
- |> at the window variant and assuming it's a standard window variant (as
- |> opposed to a custom WDEF that might have a different structure region
- |> from the standard WDEF). If anyone can improve on this, please clue
- |> the rest of us in!
- Beside checking the variant code, also get Resource info for the window
- definition procedure. If the ID is 1 then it is a standard window.
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Mon, 6 Apr 1992 21:13:42 GMT
-
- .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
-
- |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
- |> > of portRect. [Miika Asunta]
- |>
- |> No. This value will be invalid if the window has not been drawn on the
- |> screen. Since one of the primary uses of centering windows is to
- |> create the window invisible, center it, and then show it, structRgn is
- |> not a general solution to this problem.
-
- Beside checking the variant code, also get Resource info for the window
- definition procedure. If the ID is 1 then it is a standard window.
-
-
- However, there are lots of INITs that patch the standard window defProc
- so that won't work.
-
- What you do is as many others have said:
-
- 1) MoveWindow ( theWindow , 25000 , 25000 , FALSE ) ;
- 2) ShowWindow ( theWindow ) ;
- 3) SelectWindow ( theWindow ) ;
- 4) NOW you can check the structure region for the "true"
- size of the window.
- 5) MoveWindow ( theWindow , whatever you center with ) ;
-
- This will, in effect, make the window appear as if you ShowWindowed
- it after it was centered.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: f85-tno@nada.kth.se (Tommy Nordgren)
- Date: 6 Apr 92 15:14:47 GMT
- Organization: Royal Institute of Technology, Stockholm, Sweden
-
- In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>, Joe.Francis@dartmouth.edu (Joe Francis) writes:
- |> In article <1992Mar26.185108.14007@nic.funet.fi>
- |> asunta@convex.csc.FI (Miika Asunta) writes:
- |>
- |> >>How then do I determine if my window has a title-bar? (Or, just in case I've
- |> >>lost the woods for the trees, how do I accurately center my windows?)
- |> [Tim North]
- |>
- |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
- |> > of portRect. [Miika Asunta]
- |>
- |> No. This value will be invalid if the window has not been drawn on the
- |> screen. Since one of the primary uses of centering windows is to
- |> create the window invisible, center it, and then show it, structRgn is
- |> not a general solution to this problem.
- |>
- |> I even tried sending the WDEF a calc regions message to try to fool it
- |> into validating structRgn, but (under system 7, at least) this will
- |> result in confusing the window manager beyond help.
- |>
- |> I don't have a good general solution to this problem. I end up looking
- |> at the window variant and assuming it's a standard window variant (as
- |> opposed to a custom WDEF that might have a different structure region
- |> from the standard WDEF). If anyone can improve on this, please clue
- |> the rest of us in!
- Beside checking the variant code, also get Resource info for the window
- definition procedure. If the ID is 1 then it is a standard window.
-
- +++++++++++++++++++++++++++
-
- From: d88-jwa@dront.nada.kth.se (Jon W{tte)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Date: Mon, 6 Apr 1992 21:13:42 GMT
-
- .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
-
- |> > You should use rgnBBox Rect of structRgn from WindowRecord instead
- |> > of portRect. [Miika Asunta]
- |>
- |> No. This value will be invalid if the window has not been drawn on the
- |> screen. Since one of the primary uses of centering windows is to
- |> create the window invisible, center it, and then show it, structRgn is
- |> not a general solution to this problem.
-
- Beside checking the variant code, also get Resource info for the window
- definition procedure. If the ID is 1 then it is a standard window.
-
-
- However, there are lots of INITs that patch the standard window defProc
- so that won't work.
-
- What you do is as many others have said:
-
- 1) MoveWindow ( theWindow , 25000 , 25000 , FALSE ) ;
- 2) ShowWindow ( theWindow ) ;
- 3) SelectWindow ( theWindow ) ;
- 4) NOW you can check the structure region for the "true"
- size of the window.
- 5) MoveWindow ( theWindow , whatever you center with ) ;
-
- This will, in effect, make the window appear as if you ShowWindowed
- it after it was centered.
-
- - --
- h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
-
- +++++++++++++++++++++++++++
-
- From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
- Date: Fri, 10 Apr 1992 23:10:03 -0500
-
- TN> From: f85-tno@nada.kth.se (Tommy Nordgren)
-
- TN> In article <1992Mar26.212538.4018@dartvax.dartmouth.edu>,
- TN> Joe.Francis@dartmouth.edu (Joe Francis) writes:
- TN> |> In article <1992Mar26.185108.14007@nic.funet.fi>
- TN> |> asunta@convex.csc.FI (Miika Asunta) writes:
-
- TN> |> I even tried sending the WDEF a calc regions message to try to fool it
- TN> |> into validating structRgn, but (under system 7, at least) this will
- TN> |> result in confusing the window manager beyond help.
-
- If you want the strucRgn of an invisible window,
- go ahead and send the message to the WDEF and then make sure you
- SetEmptyRgn against the strucRgn and contRgn. That's the step you're
- missing. I believe there is code on the developer's CDs to do this.
- Anyway, I've seen it published before. I've certainly done it before.
-
- TN> Beside checking the variant code, also get Resource info for the window
- TN> definition procedure. If the ID is 1 then it is a standard window.
-
- The resource ID you want is 0, not 1. 1 is the round-corner black-title
- WDEF used in many DAs.
-
- ---------------------------
-
- From: slang@bnr.ca (Steven Langlois)
- Subject: Checking if modem or printer port is already in use
- Organization: Bell-Northern Research Ltd.
- Date: Tue, 31 Mar 92 14:16:20 GMT
-
- Inside Mac IV states on page 225 that "The new Serial Driver verifies
- that the serial port is correctly configured and free; if not, the
- result code portNotCf or portInUse is returned." I assume that this
- is with the old RAMSDOpen call but this is no longer supported, you
- are supposed to use OpenDriver which I now do. In fact, I could not
- find any reference to portNotCf of portInUse in the Think Pascal 4
- files. When I call OpenDriver on a port already in use, it returns
- a noErr result code.
-
- How can I detect when the modem port or serial port is in use?
-
- Any help would be much appreciated.
-
- Steven Langlois
- ISDN Basic Rate Access
- Bell-Northern Research
-
- Internet: slang@bnr.ca
-
-
- +++++++++++++++++++++++++++
-
- From: slang@bnr.ca (Steven Langlois)
- Date: 12 Apr 92 14:17:30 GMT
- Organization: Bell-Northern Research Ltd.
-
- I posted the following a while ago but have received nothing to date. Do
- I assume from this that there is no way to tell if a port in in use or
- not?
-
- Any help is greatly appreciated.
-
- Steven Langlois
- ISDN Basic Rate Access
- Bell-Northern Research
-
- Internet: slang@bnr.ca
-
- In article <1992Mar31.141620.26603@bmers95.bnr.ca>, slang@bnr.ca (Steven Langlois) writes:
- |> Inside Mac IV states on page 225 that "The new Serial Driver verifies
- |> that the serial port is correctly configured and free; if not, the
- |> result code portNotCf or portInUse is returned." I assume that this
- |> is with the old RAMSDOpen call but this is no longer supported, you
- |> are supposed to use OpenDriver which I now do. In fact, I could not
- |> find any reference to portNotCf of portInUse in the Think Pascal 4
- |> files. When I call OpenDriver on a port already in use, it returns
- |> a noErr result code.
- |>
- |> How can I detect when the modem port or printer port is in use?
- |>
- |> Any help would be much appreciated.
- |>
- |> Steven Langlois
- |> ISDN Basic Rate Access
- |> Bell-Northern Research
- |>
- |> Internet: slang@bnr.ca
- |>
-
- ---------------------------
-
- From: nessett@llnl.gov (Danny M. Nessett)
- Subject: Does MPW support aliases?
- Date: 1 Apr 92 17:25:58 GMT
- Organization: LLNL
-
- I am having trouble using a folder alias from within the MPW shell. In
- particular, if I use the finder to make an alias of a folder, place that
- alias in another folder and then try to reference the alias as a child
- folder, MPW doesn't cooperate. For example, consider the following
- MPW commands and their output :
-
- Directory
- 'DirectDrive(2):C-Development:ELROS:'
- ls -l
- Name Type Crtr Size Flags Last-Mod-Date Creation-Date
- - -------------------- ---- ---- ------ ---------- ------------------- -------------------
- any.h TEXT MPS 3K lvbspoImad 3/31/92 1:16 PM 3/31/92 1:16 PM
- doc Fldr Fldr 1776K lvbspoImad 3/31/92 1:17 PM 3/31/92 1:16 PM
- driver Fldr Fldr 27K lvbspoImad 4/1/92 8:30 AM 3/31/92 1:18 PM
- make-elros.tar TEXT ???? 5400K lvbspoImad 3/18/92 2:21 PM 3/18/92 2:11 PM
- Make.Defaults TEXT MPS 8K lvbspoImad 3/31/92 1:38 PM 3/31/92 1:16 PM
- MakeConvert TEXT MPS 3K lvbspoImad 4/1/92 8:29 AM 3/18/92 4:24 PM
- Makefile TEXT MPS 9K lvbspoImad 3/31/92 1:30 PM 3/31/92 1:16 PM
- Makeout TEXT MPS 3K lvbspoImad 4/1/92 8:35 AM 4/1/92 8:31 AM
- mypreproc Fldr Fldr 12K lvbspoImad 3/31/92 1:18 PM 3/31/92 1:18 PM
- params Fldr Fldr 9K lvbspoImad 3/31/92 1:18 PM 3/31/92 1:18 PM
- preprocessor Fldr Fldr 1998K lvbspoImad 3/31/92 1:19 PM 3/31/92 1:18 PM
- README TEXT MPS 5K lvbspoImad 3/31/92 1:16 PM 3/31/92 1:16 PM
- 'README(MAC mods)' TEXT MPS 8K lvbspoImad 3/19/92 7:40 AM 3/18/92 2:21 PM
- runtime Fldr Fldr 632K lvbspoImad 3/31/92 1:20 PM 3/31/92 1:19 PM
- tests Fldr Fldr 764K lvbspoImad 3/31/92 1:21 PM 3/31/92 1:20 PM
- Unix2MacMakeTools fdrp MACS 2K lvbspoImad 4/1/92 8:32 AM 4/1/92 8:26 AM
- UnixMakefile TEXT MPS 9K lvbspoImad 3/31/92 1:30 PM 3/31/92 1:16 PM
- util Fldr Fldr 177K lvbspoImad 3/31/92 1:21 PM 3/31/92 1:21 PM
- Directory Unix2MacMakeTools
- ### Directory - Unable to set current directory.
- # Directory not found (OS error -120)
- Directory driver
- Directory
- 'DirectDrive(2):C-Development:ELROS:driver:'
-
- Notice that "Unix2MacMakeTools" is of type fdrp and creator MACS. I created it
- by making an alias and placing it in the ELROS folder. Also notice that the
- folder "driver" is of type Fldr and creator Fldr. When I try to change the
- default folder to Unix2MacMakeTools, the command fails. However, it succeeds
- when I change it to driver.
-
- Am I missing something or is this a bug?
-
- Dan Nessett
-
-
- +++++++++++++++++++++++++++
-
- From: ksand@apple.com (Kent Sandvik)
- Date: 10 Apr 92 01:30:32 GMT
- Organization: MacDTS Mongols
-
- In article <121548@lll-winken.LLNL.GOV>, nessett@llnl.gov (Danny M. Nessett)
- writes:
- >
- > I am having trouble using a folder alias from within the MPW shell. In
- > particular, if I use the finder to make an alias of a folder, place that
- > alias in another folder and then try to reference the alias as a child
- > folder, MPW doesn't cooperate. For example, consider the following
- > MPW commands and their output :
-
- Most, if not all, MPW tools *don't* support aliases. I placed a request
- for change about this to tools engineering some time ago.
-
- Cheers,
- Kent Sandvik
- Dynamic Language Missionary
-
- +++++++++++++++++++++++++++
-
- From: dn5@apix.psu.edu (D. Jay Newman)
- Date: 10 Apr 92 20:58:47 GMT
- Organization: Penn State
-
- In article <22808@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
-
- > Most, if not all, MPW tools *don't* support aliases. I placed a request
- > for change about this to tools engineering some time ago.
-
- I *really* wish they did (at least the C++ compiler). I am working on a
- project with 6 shared files, and using aliases would be *much* easier than
- either keeping two copies of source code (which occasionally change) or
- shuttling them back and forth.
-
- I've tried to keep the shared files in a common directory, but never got
- that to work real well.
-
- Actually, I've never been too impressed with Apple's following of their
- own rules. MPW was *not* 32-bit clean long after Apple said that everything
- should be 32-bit clean. Now Apple has been preaching about aliases for
- quite some time, and still MPW doesn't know about them. Typical.
-
- ()()()()()()()()()()()()() CBEL--Teaching & Learning Technologies ()()()
- D. Jay Newman ! Save the whales
- dn5@psuvm.psu.edu ! (Collect the whole set)
- dn5@apix.psu.edu !
-
- +++++++++++++++++++++++++++
-
- From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
- Organization: The University of Western Australia
- Date: Mon, 13 Apr 1992 04:01:23 GMT
-
- In article <pj#vHmu0n6@atlantis.psu.edu>, dn5@apix.psu.edu (D. Jay Newman) writes:
- >
- > In article <22808@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
- >
- > > Most, if not all, MPW tools *don't* support aliases. I placed a request
- > > for change about this to tools engineering some time ago.
- >
- > I *really* wish they did (at least the C++ compiler). I am working on a
- > project with 6 shared files, and using aliases would be *much* easier than
- > either keeping two copies of source code (which occasionally change) or
- > shuttling them back and forth.
- >
- > I've tried to keep the shared files in a common directory, but never got
- > that to work real well.
-
- If I was a member of MPW engineering I would tell you to use Projector.
- Projector was specifically designed to support projects where two people are
- modifying shared source code. If you're going to put up with MPW's extreme
- lack of speed, the least you could do is actually use some of its neater
- features.
-
- Quinn "The Eskimo!" <quinn@cs.uwa.edu.au> "Real Coke, Diet .sig"
- Department of Computer Science, The University of Western Australia
- -- Projector's #1 biggest fan!
-
-
- ---------------------------
-
- From: thomas@garnet.berkeley.edu (Mark)
- Subject: Animating floating point numbers?
- Date: 1 Apr 92 23:14:37 GMT
- Organization: University of California, Berkeley
-
- Hi,
-
- I'm doing some animation that includes floating point numbers. The routine
- I'm using (my own) to convert from double to ascii is very slow. On my IIx
- it takes about 7 ticks. I clocked it against ThinkC's sprintf routine,
- which came out at about 8 ticks. You can see the problem - 5 doubles = 35
- ticks = .5 seconds = lousy animation!
-
- Does anyone have any ideas on how to write a ragingly fast double -> ascii
- routine?
-
- Any help would be most appreciated,
-
- Mark Thomas
-
- +++++++++++++++++++++++++++
-
- From: dougm@bradbury.cns.caltech.edu (Doug McNought)
- Organization: California Institute of Technology
- Date: Thu, 2 Apr 1992 02:35:45 GMT
-
- In article <rdg4tINNg0h@agate.berkeley.edu> thomas@garnet.berkeley.edu (Mark) writes:
- >I'm doing some animation that includes floating point numbers. The routine
- >I'm using (my own) to convert from double to ascii is very slow. On my IIx
- >it takes about 7 ticks. I clocked it against ThinkC's sprintf routine,
- >which came out at about 8 ticks. You can see the problem - 5 doubles = 35
- >ticks = .5 seconds = lousy animation!
- >
- >Does anyone have any ideas on how to write a ragingly fast double -> ascii
- >routine?
-
- Er--have you timed the Toolbox Num2Str or the SANE conversion routines? I have
- absolutely no idea whether they would be faster, but it's certainly possible.
- Remember, sprintf() has to deal with all the format string baggage, and your
- own routine may or may not be optimal. Try the built-in; Apple has been known
- to use good algorithms on occasion... :)
- regards,
- doug
- - --
- <><><><><><><><><><><><><><><>Go Orioles<><><><><><><><><><><><><><><><>
- <> Doug McNaught dougm@descartes.caltech.edu <>
- <> Help!!! I'm addicted to *Spaceward Ho!* Is there a support group? <>
- <><><><><><><><><><><><><><><>Go Orioles<><><><><><><><><><><><><><><><>
-
- +++++++++++++++++++++++++++
-
- From: dpkemp@afterlife.ncsc.mil (David P. Kemp)
- Date: 13 Apr 92 00:28:26 GMT
- Organization: The Great Beyond
-
- In article <1992Apr2.023545.25559@cco.caltech.edu> dougm@bradbury.cns.caltech.edu (Doug McNought) writes:
- >In article <rdg4tINNg0h@agate.berkeley.edu> thomas@garnet.berkeley.edu (Mark) writes:
- >>I'm doing some animation that includes floating point numbers. The routine
- >>I'm using (my own) to convert from double to ascii is very slow. On my IIx
- >>it takes about 7 ticks. I clocked it against ThinkC's sprintf routine,
- >>which came out at about 8 ticks. You can see the problem - 5 doubles = 35
- >>ticks = .5 seconds = lousy animation!
- >Er--have you timed the Toolbox Num2Str or the SANE conversion routines? I have
- >absolutely no idea whether they would be faster, but it's certainly possible.
- >... Apple has been known to use good algorithms on occasion... :)
-
- A good algorithm in this case would be to avoid binary <-> ascii conversion
- entirely. Any time you do formatted writes and reads, you're gonna be
- slow. The only reason to use ascii is if a human is going to look at the
- data, or if you are going to move it to a machine with a different
- architecture. If both your data generating program and your animation
- program are running on the same machine, just use unformatted I/O. It'll
- be MUCH faster.
-
-
- - --
- Dave Kemp dpkemp@afterlife.ncsc.mil "Pave the Bay!"
- #include <std/disclaimer>
-
- ---------------------------
-
- From: kevind@pogo.wv.tek.com (Kevin Draz)
- Subject: Discipline, Mbg 6.2.2, Quadra
- Date: 2 Apr 92 02:21:02 GMT
- Organization: Tektronix Inc., Beaverton, Or.
-
-
- Does anyone have any information on running Discipline on a Quadra [900]
- with MacsBug 6.2.2?
-
- I use 7.0.1 with tuner 1.1, both at home on my IICX where everything works
- fine, and here at work on the Quadra, where it's flaming death. [Bus Error]
- before it even gets fully initialized.
-
- I've tried disabling caches, going back to 24 bit addressing, no VM, no
- inits, etc. and it's all the same. Kaboom! In 24 bit at least it tries to
- load the prefs file before dying.
-
- I tried Disc. 2.0b1 from ETO#5, and also the released 1.something.
- 1.something, as an INIT, doesn't bomb, but instead says "Unknown error due
- to your debugger" or some such noise at bootup, and fails to load.
-
- I usually like to bang my head until I figure things out myself, but I'm
- getting desparate, so I'll share my frustration with the net.
-
- All help greatly appreciated.
-
- KevinD
-
-
- - --
- - ----
- kevind@pogo.wv.tek.com | For most software publishers, quality is job 1.01.
- Tektronix Color Printers| -- MacWeek Magazine
-
- +++++++++++++++++++++++++++
-
- From: ksand@apple.com (Kent Sandvik)
- Date: 10 Apr 92 23:05:48 GMT
- Organization: MacDTS Mongols
-
- In article <12547@pogo.wv.tek.com>, kevind@pogo.wv.tek.com (Kevin Draz) writes:
- >
- >
- > Does anyone have any information on running Discipline on a Quadra [900]
- > with MacsBug 6.2.2?
- >
- > I use 7.0.1 with tuner 1.1, both at home on my IICX where everything works
- > fine, and here at work on the Quadra, where it's flaming death. [Bus Error]
- > before it even gets fully initialized.
- >
- > I've tried disabling caches, going back to 24 bit addressing, no VM, no
- > inits, etc. and it's all the same. Kaboom! In 24 bit at least it tries to
- > load the prefs file before dying.
-
-
- Welcome to the wonderful world of new CPU releases and old tools which
- break. Try Discipline 2.0.2 from ETO#7.
-
- Cheers,
- Kent Sandvik/DTS
-
- ---------------------------
-
- From: kcheng@ecs.umass.edu
- Subject: THINK C PROGRAM QUESTION
- Date: 2 Apr 92 13:37:26 GMT
-
- Need help with THINK C PROGRAM on mac
-
-
- I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
- said "bad F-line instruction" What does this mean?
-
- Thank you for your help.
-
-
- Hong Cheng
-
- +++++++++++++++++++++++++++
-
- From: asunta@convex.csc.FI (Miika Asunta)
- Date: 4 Apr 92 17:02:49 GMT
- Organization: Finnish Academic and Research Network Project - FUNET
-
- In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
-
- >Need help with THINK C PROGRAM on mac
-
-
- >I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
- >said "bad F-line instruction" What does this mean?
-
-
- that means you have a... Bug!
-
- Learn to use source level debugger to find out where the bug is,
- then study the code carefully, and after heureka,
- eliminate the bug. Easy.
-
- Miika
- - --
- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
- & Miika Asunta & asunta@convex.csc.fi & Double Bass Player &
- & tel. +358-0-494 093 & & Macintosh Programmer &
- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
-
- +++++++++++++++++++++++++++
-
- From: ksand@apple.com (Kent Sandvik)
- Date: 10 Apr 92 01:35:15 GMT
- Organization: MacDTS Mongols
-
- In article <1992Apr4.170249.15465@nic.funet.fi>, asunta@convex.csc.FI (Miika
- Asunta) writes:
- >
- > In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
- >
- > >Need help with THINK C PROGRAM on mac
- >
- >
- > >I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
- > >said "bad F-line instruction" What does this mean?
- >
- >
- > that means you have a... Bug!
- >
- > Learn to use source level debugger to find out where the bug is,
- > then study the code carefully, and after heureka,
- > eliminate the bug. Easy.
-
- Jos sinulla on (sorry, back from Finnish to English mode), if you got
- a Quadra, then depending on the debugger patches in Think C 5.0 it's a
- problem related to the sudden use of the F-line vector for Omega-SANE
- use (for trig functions missing in the built-in FPU). It's fixed with
- later patches for Think C, and SADE, and SourceBug, and ...
-
- If this is not a Quadra, then you got problems!
-
- Cheers,
- Kent Sandvik
- Dynamic Language Politician
-
- +++++++++++++++++++++++++++
-
- From: cpastore@unity.ncsu.edu (Chris Pastore)
- Organization: North Carolina State University Computing Center
- Date: Fri, 10 Apr 1992 17:08:11 GMT
-
- >> In <17361.29db0e17@ecs.umass.edu> kcheng@ecs.umass.edu writes:
-
- >>>I run my C program on the Mac II using THINK C 5.01 and it keeps crashing and
- >>>said "bad F-line instruction" What does this mean?
-
- >> that means you have a... Bug!
-
- Also, Think C has conflicts with lots of INITs. It might be something
- that simple. Get rid of them all and try again.
-
-
- - --
- Christopher M. Pastore |Life would be so pleasant
- NC State University |If we all could be
- Textile Materials Science |Helpless, homeless creatures
- cpastore@nelson.tx.ncsu.edu |Marching to the sea.
-
- ---------------------------
-
- From: jacbop@z.eecs.umich.edu (Thomas Wilberding)
- Subject: Simple Sound Program
- Date: 3 Apr 92 21:25:45 GMT
- Organization: University of Michigan EECS Dept., Ann Arbor
-
- I'm trying to write a simple program that will just play a 'snd ' res.
- I compiled the following program with THINK 5.0 and put a sound ID=128 into
- the application.
-
- What I'd hoped would happen is, that teh sound would play and the app would
- quit. However I get error code -205 (badChannel, Channel is corrupt or
- unusable).
-
- I also tried to use PlaySnd() after using GetResource(). This didn't
- work either.
-
- _________________________________________________________________________
- #include <Types.h>
- #include <Sound.h>
-
- int PlayFromFile(int);
-
- void main()
- {
- PlayFromFile(128);
- }
-
- int PlayFromFile(int myResNum)
- {
- SndChannelPtr mySndChan;
-
- mySndChan = NULL;
- SndNewChannel(mySndChan,sampledSynth,initMono,NULL);
-
- SndStartFilePlay(mySndChan,0,myResNum,16*1024,NULL,NULL,NULL,1);
-
- if (mySndChan != NULL) {
- SndDisposeChannel(mySndChan,0);
- }
- }
- _________________________________________________________________________
-
- If you haven't guessed, I have no clue how to program the Mac and really
- have no "World View". I'm just taking Chap 22 of Vol VI very literally
- and hoping things will work without knowing the big picture.
-
- Perhaps a kind soul could point me towards some sample code for sound
- input. Eventually, I want to write my own XCMD's to record/play AIFF
- files for use in Supercard 1.6. The Hypercard audio palette won't work
- with a standalone Supercard stack.
-
- Thanks in advance,
- Tom
-
-
- - --
- Tom Wilberding
- jacbop@eecs.umich.edu
- jacbop@engin.umich.edu
-
- +++++++++++++++++++++++++++
-
- From: REEKES@applelink.apple.com (Jim Reekes)
- Date: 10 Apr 92 20:01:59 GMT
- Organization: Apple Computer, Inc.
-
- In article <1992Apr3.212545.18525@zip.eecs.umich.edu>, jacbop@z.eecs.umich.edu (Thomas Wilberding) writes:
- >
- > I'm trying to write a simple program that will just play a 'snd ' res.
- > I compiled the following program with THINK 5.0 and put a sound ID=128 into
- > the application.
- >
- > What I'd hoped would happen is, that teh sound would play and the app would
- > quit. However I get error code -205 (badChannel, Channel is corrupt or
- > unusable).
- >
- > I also tried to use PlaySnd() after using GetResource(). This didn't
- > work either.
- >
- > _________________________________________________________________________
- > #include <Types.h>
- > #include <Sound.h>
- >
- > int PlayFromFile(int);
- >
- > void main()
- > {
- > PlayFromFile(128);
- > }
- >
- > int PlayFromFile(int myResNum)
- > {
- > SndChannelPtr mySndChan;
- >
- > mySndChan = NULL;
- > SndNewChannel(mySndChan,sampledSynth,initMono,NULL);
- >
- > SndStartFilePlay(mySndChan,0,myResNum,16*1024,NULL,NULL,NULL,1);
- >
- > if (mySndChan != NULL) {
- > SndDisposeChannel(mySndChan,0);
- > }
- > }
- > _________________________________________________________________________
- >
- > If you haven't guessed, I have no clue how to program the Mac and really
- > have no "World View". I'm just taking Chap 22 of Vol VI very literally
- > and hoping things will work without knowing the big picture.
- >
- > Perhaps a kind soul could point me towards some sample code for sound
- > input. Eventually, I want to write my own XCMD's to record/play AIFF
- > files for use in Supercard 1.6. The Hypercard audio palette won't work
- > with a standalone Supercard stack.
- >
- > Thanks in advance,
- > Tom
- >
- >
- > --
- > Tom Wilberding
- > jacbop@eecs.umich.edu
- > jacbop@engin.umich.edu
-
-
- 1. Don't use type int for the toolbox. You're passing int as the refNum.
- This could be bad. Use short as defined in Inside Mac.
-
- 2. SndNewChannel returns an error, as does SndStartFilePlay. NEVER ignore
- errors. For example, don't call the second trap if the first one failed.
-
- 3. SndNewChannel is defined to take a VAR parameter of type SndChannelPtr.
- You've passed SndChannelPtr, and it's supposed to be a pointer to a
- SndChannelPtr. If you recompile you're MacHeaders and turn on prototype
- checking for toolbox routines. By default, it's off. This SUCKS! You
- should always have this turned on. Open the file "Mac #includes.c".
- Change the definition of SIMPLIFY_PROTOTYPES to be true. Then precompile
- the file and save it as MacHeaders. Then if you attempt to build your
- program it will complain that you've incorrectly called SndNewChannel.
-
- 4. If you call SndStartFilePlay with a channel, you can play it asynchronously.
- If you call SndDisposeChannel immediately afterwards, with quietNow set
- to false then it's just like calling SndStartFilePlay "synchronously."
- You should and a call to SndChannelStatus to your event loop and dispose
- of the channel when the busy flag is false.
-
- 5. You have to use a value of 20000 or greater for the size of the buffers
- passed to SndStartFilePlay.
-
- 6. Use the constants true and false, instead of 1 and 0.
-
-
- Ok, now I'm starting to become annoying.
-
-
- - -----------------------------------------------------------------------
- Jim Reekes, E.O. | Macintosh Toolbox Engineering
- | Sound Manager Expert
- Apple Computer, Inc. | "All opinions expressed are mine, and do
- 20525 Mariani Ave. MS: 81-KS | not necessarily represent those of my
- Cupertino, CA 95014 | employer, Apple Computer Inc."
-
- ---------------------------
-
- From: caruso@gbi01.enet.dec.com (Angelo Caruso)
- Subject: UPMG II
- Date: 3 Apr 92 07:42:27 GMT
- Organization: Digital Equipment Corporation
-
- I have heard about a Usenet Macintosh Programming Guide 2nd volume.
- Is it true ? Where is it available ?
-
- Thanks.
-
- +++++++++++++++++++++++++++
-
- From: mxmora@unix.SRI.COM (Matt Mora)
- Date: 10 Apr 92 16:48:13 GMT
- Organization: SRI International, Menlo Park, California
-
- In article <1992Apr3.064129.17144@vbohub.vbo.dec.com> caruso@gbi01.enet.dec.com (Angelo Caruso) writes:
-
- >I have heard about a Usenet Macintosh Programming Guide 2nd volume.
- >Is it true ? Where is it available ?
-
- No. Not for a while.
-
-
-
- Matt
-
-
- - --
- ___________________________________________________________
- Matthew Mora | my Mac Matt_Mora@sri.com
- SRI International | my unix mxmora@unix.sri.com
- ___________________________________________________________
-
- ---------------------------
-
- From: essam@gagme.chi.il.us (Essam Khairullah)
- Subject: Centering window from an INIT; how?
- Organization: Gagme Public Access UNIX, Chicago, Illinois.
- Date: Tue, 7 Apr 1992 09:54:51 GMT
-
- I've written an INIT that pops up a window sometime after startup. Basically
- I'd like to know how to be able to center its window in the main screen.
-
- Normally this should be easy, but you don't have access to QuickDraw's globals
- from an INIT, or do you? Note that I don't want to use System 7's auto
- centering; I would like it to work on older system versions as well.
-
- Any help would be greatly appreciated!
-
- - --
- Essam Badi' Abu Khalil Khairullah
- essam@gagme.chi.il.us
- I don't got no fancy signature!
- I'm a .signature virus. You can't resist copying me into your .signature!
-
- +++++++++++++++++++++++++++
-
- From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
- Date: Fri, 10 Apr 1992 23:32:41 -0500
-
- EK> From: essam@gagme.chi.il.us (Essam Khairullah)
- EK> Newsgroups: comp.sys.mac.programmer
- EK> Organization: Gagme Public Access UNIX, Chicago, Illinois.
- EK>
- EK> I've written an INIT that pops up a window sometime after startup.
- EK> Basically, I'd like to know how to be able to center its window in
- EK> the main screen.
- EK>
- EK> Normally this should be easy, but you don't have access to QuickDraw's
- EK> globals from an INIT, or do you?
-
- Choose one of these three calls: GetWMgrPort, GetGrayRgn, or OpenPort.
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-